package com.qsd.TeacherSystem.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.qsd.TeacherSystem.Service.StudentService;
import com.qsd.common.po.Student;

import javax.annotation.Resource;

/**
 * 学生信息
 * create by it_mck·Miao
 *
 */
@Slf4j
@Controller
@RequestMapping("student")
public class StudentController {
	
	@Resource
	private StudentService studentService;

	@GetMapping("info")
	public ModelAndView info(String username) {
		log.info("查询学生信息:{}",username);
		ModelAndView modelAndView = new ModelAndView("student/info");
		Student student = studentService.info(username);
		log.info("student:{}",student);
		modelAndView.addObject("student", student);
		return modelAndView;
	}
	
}
